﻿using FH.Application.NewsApp;
using FH.Application.NewsApp.Dtos;
using FH.Application.UserApp;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;

namespace WebSite.Controllers
{
    public class NewsController : FHController
    {
        private readonly INewsAppService _service;
       
        public NewsController(INewsAppService service
             , ISettingService settingService) : base(settingService)
        {
            _service = service;
        }
        public IActionResult Index()
        {
            int total = 0;
            List<NewsDto> list = _service.GetNewsPage(1, 100, out total);
            return View(list);
        }
        public IActionResult Detail(Guid id)
        {
            NewsDto news = _service.Get(id);
            return View(news);
        }
    }
}